﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace UCL.Powersource
{
    [DataContract(IsReference=true)]
    public abstract class TimeFrame : PropertyChangedBase, ITimeFrame
    {



        #region SourcePath

        /// <summary>
        /// Field storage for property SourcePath
        /// </summary>
        [DataMember]
        private string _SourcePath = default(string);

        /// <summary>
        /// Property SourcePath. TODODOC: Insert appropriate summary here
        /// </summary>
        public string SourceBranchPath
        {
            get { return _SourcePath; }
            set { if (_SourcePath == value) return; _SourcePath = value; SourcePath_RecalculateDependencies(); }
        }

        private void SourcePath_RecalculateDependencies()
        {
            //Recalculate all properties here

            //NotifyOfPropertyChange is usually placed as last statement - first change all dependencies and then fire property change
            NotifyOfPropertyChange(() => SourceBranchPath);
        }

        private void SourcePath_Recalculate()
        {
            _SourcePath = default(string);
            //Insert your code here

            SourcePath_RecalculateDependencies();
        }

        #endregion

        public abstract string Label { get; set; }
        [DataMember]
        public TimeFrameTypes TimeFrameType
        {
            get;
            protected set;
        }
    }
}
